package com.gzz.orchid.main.facade.controller.pojo.record;

public record ValidatedUserRecord(String username, String email) {
    public ValidatedUserRecord {
        if (username == null || username.isBlank()) {
            throw new IllegalArgumentException("Username cannot be blank");
        }
        if (email == null || email.isBlank()) {
            throw new IllegalArgumentException("Email cannot be blank");
        }
        if (!email.contains("@")) {
            throw new IllegalArgumentException("Email must contain @");
        }
    }
}
